<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html class="x-admin-sm">
    
    <head>
        <meta charset="UTF-8">
        <title>欢迎页面-X-admin2.2</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="<%=basePath %>leyuiyc/css/font.css">
        <link rel="stylesheet" href="<%=basePath %>leyuiyc/css/xadmin.css">
        <script src="<%=basePath %>leyuiyc/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="<%=basePath %>leyuiyc/js/xadmin.js"></script>
		<style>
		    /* body{overflow-y: scroll;} */ /* 禁止刷新后出现横向滚动条 */
		    /* .layui-table-body .layui-table,.layui-table-header .layui-table{width: 100%;}
			.layui-table-body.layui-table-main .layui-table-cell,.layui-table-header .layui-table-cell{white-space: pre-wrap;word-wrap: break-word; word-break: break-all; height: auto;} */
		</style>
        <script src="<%=basePath %>leyuiyc/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="<%=basePath %>leyuiyc/js/xadmin.js"></script>
		
    </head>
    
    <body>
        
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            <form class="layui-form layui-col-space5">
                                <div class="layui-input-inline layui-show-xs-block" >
                                    <select name="type">
                                        <option value="">操作类型</option>
                                        <option value="1">首页操作</option>
                                        <option value="2">品牌操作</option>
                                        <option value="3">分类操作</option>
                                        <option value="4">商品操作</option>
                                        </select>
                                </div>
                                <div class="layui-inline layui-show-xs-block">
                                    <button class="layui-btn"  lay-submit="" lay-filter="search"><i class="layui-icon">&#xe615;</i></button>
                                </div>
                            </form>
                        </div>
                        <div class="layui-card-body ">
                            <table class="layui-table layui-form" id="test" lay-filter="test">
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    
    
    <script>
			layui.use(['table','form','jquery'], function(){
			  var table = layui.table,
			  form = layui.form ;
			  table.render({
			    elem: '#test'
			    ,url:'selectTvUserOpera.do'
			    ,width: 'auto'
			    ,height: 650
			    ,method: 'post'
			    ,toolbar: true
			    ,title: '操作列表'
			    ,totalRow: true
			    ,page: true
			    ,cols: [[
			      {field:'i', width:300, title: '序号', sort: true, fixed: 'left'}
			      ,{field:'userName', width:300, title: '用户名称'}
			      ,{field:'text', width:300, title: '操作对象'}
			      ,{field:'type', width:300, title: '操作类型' ,templet:'#type'}
			      ,{field:'time', width: 300, title: '操作时间'}
			    ]]
			    ,even:true
			    ,skin: 'row' //表格风格
                ,limits:[10,20,30,40,50]
			    ,limit: 20 //每页默认显示的数量
			  });
			  //数据筛选
		        form.on('submit(search)',function(data){
		            //执行重载
		            table.reload('test', {
		                where:data.field,
		                	page : {
								curr : 1 //从第一开始查看
						}
		            });
		            return false;
		        });
		       
			});
			
	</script>
	<script type="text/html" id="type">	
	   {{#  if(d.type == "1") {  }}
			<font color="#00ff00">首页操作</font>
		{{#  } else if(d.type == "2") {  }}
			<font color="#ff0000">品牌操作</font>
         {{#  } else if(d.type == "3") {  }}
			<font color="#ff0000">分类操作</font>
		{{#  } else if(d.type == "4") {  }}
			<font color="#ff0000">商品操作</font>
		{{#  }  }}
    </script>
   

</html>